﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using SMA = System.Management.Automation;

namespace RSPowershell
{
    [System.Management.Automation.Cmdlet("New", "RSDeviceInfo")]
    public class New_RSDeviceInfo : SMA.Cmdlet
    {
        [SMA.Parameter(Mandatory = false)]
        public string PageWidth;

        [SMA.Parameter(Mandatory = false)]
        public string PageHeight;

        [SMA.Parameter(Mandatory = false)]
        public string MarginTop;

        [SMA.Parameter(Mandatory = false)]
        public string MarginBottom;

        [SMA.Parameter(Mandatory = false)]
        public string MarginLeft;

        [SMA.Parameter(Mandatory = false)]
        public string MarginRight;

        protected override void ProcessRecord()
        {
            var devinfo = new DeviceInfo();
            devinfo.PageWidth = this.PageWidth;
            devinfo.PageHeight = this.PageHeight;
            devinfo.MarginTop = this.MarginTop;
            devinfo.MarginBottom = this.MarginBottom;
            devinfo.MarginLeft = this.MarginLeft;
            devinfo.MarginRight = this.MarginRight;
            this.WriteObject(devinfo);
        }
    }
}
